package cn.rslee.scala.demos

object ValuesApp extends App {
  
  // Integer
  val myInt = 3
  // Float
  val myDouble = 4.0
  
  // Char
  val myChar = 'c'
  
  // String
  val myStr = "Hello"
  
  //XML
  val myXml = <a href="http://www.baidu.com/">{myStr}</a>
  
  // Tuples
  val myTuples = (myStr,myDouble)
  
  // Lists
  val myList = List(1,2,3,4)
  
  // Ranges
  val myRange = 1 to 100
  
  //Map
  val myMap = Map(1 -> "like", 30 -> "java")
  
  // Set
  val mySet = Set(1,2,4,7,8)
  
  // Array
  val myArray = Array(1,2,3,4,5,6)
  val myArray2 = Array(1 to 100)
  
  // Unit 类似于void
  val u = ()
  
  // null
  val myNull = null
  // None
  val myNone = None
  
  // Functions
  def myFunc( x : Int) = x +1
  
  // 匿名函数
  def anFunc = ((x : Int) => x +1)

}